package com.yao.controller;

import com.yao.common.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class Test {

    @GetMapping
    public Result<Object> test() {
        try {
            int a = 10;
        } catch (Exception e) {
            System.out.println("catch");
        } finally {
            System.out.println("finally");
        }
//        System.out.println("test");
//        return Result.success("test success");
        return null;
    }

    @GetMapping("2")
    public Result<Object> test2() throws InterruptedException {
        System.out.println("test2");
        Thread.sleep(1000);
        return Result.success("世界你好!!!");
    }
}
